<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- saved from url=(0079)http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/blackboxtests.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CoffeeMaker Example Black Box Test Cases</title>

<link href="./CoffeeMaker Example Black Box Test Cases_files/tutorial.css" rel="stylesheet" type="text/css">
</head>

<body>
<p class="title">CoffeeMaker Example Black Box Test Cases </p>
<hr align="left" width="765">
<span class="body"><a href="http://www.ncsu.edu/">North Carolina State University<br>
</a><a href="http://courses.ncsu.edu/csc326/">CSC 326</a> - Software Engineering<br>
Laurie Williams, Dright Ho, <a href="mailto:sesmith5@ncsu.edu?subject=CSC326%20Lab%20Tutorials%20-%20CoffeeMaker%20Example%20Tests">Sarah Smith</a></span>
<p><a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/" class="body">Back to Software Engineering Tutorials</a></p>
<hr align="left" width="765">
<table width="765" border="0" cellspacing="0" cellpadding="5">
  <tbody><tr>
    <td class="body"><p>The tests outlined below are the black box and acceptance test cases for the Coffee Maker Example. The CoffeeMaker is a command line interface application that will server as the software of a Coffee Maker. <a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/index.html">User Stories and Use Cases</a>. </p>
      <p>To run the CoffeeMaker example, run the Main class. The Main class provides the command line interface functionality that is used for testing of the back end software. Later a new class will be written that interfaces with the actual CoffeeMaker hardware, based on the functionality of the Main class. </p>
      <table width="765" border="1" cellspacing="0" cellpadding="0">
      <tbody><tr>
        <td width="91"><div align="center"><strong>Test ID </strong></div></td>
        <td width="288"><div align="center"><strong>Description</strong></div></td>
        <td width="288"><div align="center"><strong>Expected Results </strong></div></td>
        <td width="88"><div align="center"><strong>Actual Results </strong></div></td>
      </tr>
      <tr>
        <td>checkOptions1*</td>
        <td><p>Precondition: Run CoffeeMaker <br>
          Enter: Menu option 0, "Exit"
        </p>          </td>
        <td>Program Exits </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkOptions2</td>
        <td>Precondition: Run CoffeeMaker <br>
Enter: Menu option 1, "Add a recipe "</td>
        <td>Add Recipe Functionality</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkOptions3</td>
        <td>Precondition: Run CoffeeMaker <br>
Enter: Menu option 2, "Delete a recipe "</td>
        <td>Delete Recipe Functionality </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkOptions4</td>
        <td>Precondition: Run CoffeeMaker <br>
Enter: Menu option 5, "Edit a recipe "</td>
        <td>Edit Recipe Functionality </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkOptions5</td>
        <td>Precondition: Run CoffeeMaker <br>
Enter: Menu option 4, "Add inventory"</td>
        <td>Add Inventory Functionality </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkOptions6</td>
        <td>Precondition: Run CoffeeMaker <br>
Enter: Menu option 5, "Check inventory"</td>
        <td>Inventory Displays </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkOptions7</td>
        <td>Precondition: Run CoffeeMaker <br>
Enter: Menu option 6, "Make coffee"</td>
        <td>Make Coffee Functionality </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe1*</td>
        <td><p>Precondition: Run CoffeeMaker <br>
  Enter: Menu option 1, "Add a recipe "<br>
  Name: Coffee<br>
  Price: 50<br>
  Coffee: 3<br>
  Milk: 1<br>
  Sugar: 1<br>
  Chocolate: 0<br>
  Return to main menu.
  <br>
          </p>          </td>
        <td>Coffee successfully added.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe2</td>
        <td><p>Precondition: Run CoffeeMaker, addRecipe1 <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Coffee<br>
      Price: 50<br>
      Coffee: 3<br>
      Milk: 1<br>
      Sugar: 1<br>
      Chocolate: 0<br>
      Return to main menu.
          </p>
          </td>
        <td>Coffee could not be added.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe3</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Mocha <br>
      Price: -50<br>
      Return to main menu. <br>
        </p></td>
        <td>Mocha could not be added. Price can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe4</td>
        <td><p>Precondition: Run CoffeeMaker <br>
    Enter: Menu option 1, "Add a recipe "<br>
    Name: Mocha <br>
    Price: 60<br>
    Coffee: -3
    <br>
    Return to main menu.
    <br>
              </p>
          </td>
        <td>Mocha could not be added. Units of coffee can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe5</td>
        <td><p>Precondition: Run CoffeeMaker <br>
    Enter: Menu option 1, "Add a recipe "<br>
    Name: Mocha <br>
    Price: 60<br>
    Coffee: 3<br>
    Milk: -2
    <br>
    Return to main menu.
    <br>
              </p>
          </td>
        <td>Mocha could not be added. Units of milk can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe6</td>
        <td><p>Precondition: Run CoffeeMaker <br>
    Enter: Menu option 1, "Add a recipe "<br>
    Name: Mocha <br>
    Price: 60<br>
    Coffee: 3<br>
    Milk: 2<br>
    Sugar: -2
    <br>
    Return to main menu. <br>
              </p>
          </td>
        <td>Mocha could not be added. Units of sugar can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe7</td>
        <td><p>Precondition: Run CoffeeMaker <br>
    Enter: Menu option 1, "Add a recipe "<br>
    Name: Mocha <br>
    Price: 60<br>
    Coffee: 3<br>
Milk: 2<br>
Sugar: 2<br>
Chocolate: -3
<br>
Return to main menu.
<br>
        </p></td>
        <td>Mocha could not be added. Units of chocolate can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe8</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Mocha <br>
      Price: a<br>
      Return to main menu. 
          </p>
          </td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe9</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Mocha <br>
      Price: 60<br>
      Coffee: a <br>
      Return to main menu.
      <br>
        </p></td>
        <td>Please input an integer..</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe10</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Mocha <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: a <br>
      Return to main menu.</p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe11</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Mocha <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 2<br>
      Sugar: a <br>
      Return to main menu.
      <br>
        </p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe12</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Mocha <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 2<br>
      Sugar: 2<br>
      Chocolate: a <br>
      Return to main menu.
      <br>
        </p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe13</td>
        <td><p>Precondition: Run CoffeeMaker, addRecipe1 <br>
    Enter: Menu option 1, "Add a recipe "<br>
    Name: Mocha <br>
    Price: 60<br>
    Coffee: 3<br>
    Milk: 2<br>
    Sugar: 2<br>
    Chocolate: 3 <br>
    Return to main menu.</p>
          </td>
        <td>Coffee successfully added.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe14</td>
        <td><p>Precondition: Run CoffeeMaker, addRecipe13<br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Latte <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 3 <br>
      Sugar: 2<br>
      Chocolate: 0<br>
      Return to main menu.
          </p>
          </td>
        <td>Coffee successfully added.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addRecipe15</td>
        <td><p>Precondition: Run CoffeeMaker, addRecipe14 <br>
      Enter: Menu option 1, "Add a recipe "<br>
      Name: Hot Chocolate<br>
      Price: 60<br>
      Coffee: 0 <br>
      Milk: 2<br>
      Sugar: 2<br>
      Chocolate: 3 <br>
      Return to main menu.
      <br>
        </p></td>
        <td>Coffee could not be added.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>deleteRecipe1*</td>
        <td><p>Precondition: addRecipe1 has run successfully<br>
          Enter: Menu option 2, "Delete a recipe "<br>
          Select: Coffee<br>
          Return to main menu. <br>
</p>          </td>
        <td><p>Successfully deleted</p>          </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>deleteRecipe2</td>
        <td>Precondition: Run CoffeeMaker<br>
          Enter: Menu option 2, "Delete a recipe "<br>
          Return to main menu. </td>
        <td>There are no recipes to delete</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe1*</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
      Enter: Menu option 3, "Edit a recipe "<br>
      Select: Coffee      <br>
              Price: 50<br>
              Coffee: 3<br>
              Milk: 1<br>
              Sugar: 1<br>
              Chocolate: 0 <br>
              Return to main menu.
              <br>
          </p>          </td>
        <td>Coffee successfully added.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe2</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 50<br>
      Coffee: 3<br>
      Milk: 1<br>
      Sugar: 1<br>
      Chocolate: 0<br>
      Return to main menu. <br>
        </p></td>
        <td>Coffee could not be edited.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe3</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: -50<br>
      Return to main menu.      <br>
        </p></td>
        <td>Coffee could not be edited. Price can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe4</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: -3 <br>
      Return to main menu.      <br>
        </p></td>
        <td>Coffee could not be edited. Units of coffee can not be negative. <br>    </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe5</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: -2 <br>
      Return to main menu.      <br>
        </p></td>
        <td>Coffee could not be edited. Units of milk can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe6</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 2<br>
      Sugar: -2 <br>
      Return to main menu.      <br>
        </p></td>
        <td>Coffee could not be edited. Units of sugar can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe7</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 2<br>
      Sugar: 2<br>
      Chocolate: -3 <br>
      Return to main menu.      <br>
        </p></td>
        <td>Coffee could not be edited. Units of chocolate can not be negative. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe8</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
          Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: a <br>
      Return to main menu.      <br>
        </p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe9</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: a <br>
      Return to main menu.      <br>
        </p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe10</td>
        <td><p>Precondition: Run CoffeeMaker <br>
      Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: a <br>
      Return to main menu.      <br>
        </p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe11</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
          Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 2<br>
      Sugar: a <br>
      Return to main menu.      <br>
        </p></td>
        <td>Please input an integer.</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>editRecipe12</td>
        <td><p>Precondition: addRecipe1 has run successfully <br>
          Enter: Menu option 3, "Edit a recipe "<br>
Select: Coffee <br>
      Price: 60<br>
      Coffee: 3<br>
      Milk: 2<br>
      Sugar: 2<br>
      Chocolate: a <br>
      Return to main menu.      <br>
        </p></td>
        <td>Please input an integer. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory1*</td>
        <td><p>Precondition: Run CoffeeMaker<br>
          Enter: Menu option 4, "Add inventory" <br>
          Coffee: 5<br>
          Milk: 3<br>
          Sugar: 7<br>
          Chocolate: 2
          <br>
          Return to main menu.</p>          </td>
        <td><p>Inventory successfully added</p>          </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory2</td>
        <td>Precondition: Run CoffeeMaker<br>
          Enter: Menu option 4, "Add inventory" <br>
          Coffee: -1 <br>
          Return to main menu. </td>
        <td>Cannot add inventory. Units of coffee can not be negative </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory3</td>
        <td>Precondition: Run CoffeeMaker<br>
     Enter: Menu option 4, "Add inventory" <br>
    Coffee: 5 <br>
    Milk: -1 <br>
    Return to main menu. </td>
        <td>Cannot add inventory. Units of milk can not be negative </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory4</td>
        <td>Precondition: Run CoffeeMaker<br>
    Enter: Menu option 4, "Add inventory" <br>
    Coffee: 5<br>
    Milk: 3<br>
    Sugar: -1 <br>
    Return to main menu. </td>
        <td>Cannot add inventory. Units of sugar can not be negative </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory5</td>
        <td><p>Precondition: Run CoffeeMaker<br>
              Enter: Menu option 4, "Add inventory" <br>
      Coffee: 5<br>
      Milk: 3<br>
      Sugar: 7<br>
      Chocolate: -1 <br>
      Return to main menu.        </p>          </td>
        <td>Cannot add inventory. Units of chocolate can not be negative </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory6</td>
        <td>Precondition: Run CoffeeMaker<br>
    Enter: Menu option 4, "Add inventory" <br>
    Coffee: a <br>
    Return to main menu. </td>
        <td>Please input an integer. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory7</td>
        <td>Precondition: Run CoffeeMaker<br>
    Enter: Menu option 4, "Add inventory" <br>
    Coffee: 5 <br>
    Milk: a <br>
    Return to main menu. </td>
        <td>Please input an integer. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory8</td>
        <td>Precondition: Run CoffeeMaker<br>
    Enter: Menu option 4, "Add inventory"<br>
    Coffee: 5<br>
    Milk: 3<br>
    Sugar: a <br>
    Return to main menu. </td>
        <td>Please input an integer. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>addInventory9</td>
        <td>Precondition: Run CoffeeMaker<br>
    Enter: Menu option 4, "Add inventory"<br>
    Coffee: 5<br>
    Milk: 3<br>
    Sugar: 7<br>
    Chocolate:a<br>
    Return to main menu. </td>
        <td>Please input an integer. </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>checkInventory*</td>
        <td>Precondition:Run CoffeeMaker<br>
          Enter: Menu option 5, "Check inventory"<br>
          Return to main menu. </td>
        <td>Coffee: 15<br>
          Milk: 15<br>
          Sugar: 15 <br>
          Chocolate: 15 </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>purchaseBeverage1*</td>
        <td><p>Precondition: addRecipe1 has successfully run<br>
          Enter: Menu option 6, "Make coffee "<br>
Select: Coffee <br>
          Amount: 60<br>
          Return to main menu. <br>
Enter: Menu option 5, "Check inventory "<br>
Return to main menu.          <br>
        </p>          </td>
        <td><p>Your change is 10.<br>
          <br>
              Coffee: 12<br>
Milk: 14<br>
Sugar: 14<br>
Chocolate: 15</p>          </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>purchaseBeverage2</td>
        <td><p>Precondition: addRecipe1 has successfully run<br>
          Enter: Menu option 3, "Make coffee "<br>
Select: Coffee <br>
          Amount: 40 <br>
          Return to main menu.
          <br>
           Enter: Menu option 5, "Check inventory "<br>
           Return to main menu.
          </p>
          </td>
        <td><p>Your change is 40 <br>
          <br>
            Coffee: 15<br>
            Milk: 15<br>
          Sugar: 15<br>
          Chocolate: 15
        </p>          </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>purcahse Beverage3 </td>
        <td><p>Precondition: Run CoffeeMaker<br>
          Enter: Menu option 1, "Add a recipe."<br>
          Name: Coffee<br>
          Price: 50<br>
          Coffee: 16<br>
          Milk: 1<br>
          Sugar: 1<br>
          Chocolate: 0<br>
          Return to main menu.<br>
          Enter: Menu option 6, "Make coffee"<br>
          Price: 50<br>
          Return to main menu.
        </p>          </td>
        <td><p>Your change is 50</p>          </td>
        <td>&nbsp;</td>
      </tr>
    </tbody></table>      
      <p>&nbsp;</p>
    </td>
  </tr>
</tbody></table>
<hr align="left" width="765">
<table width="542" border="0" cellspacing="0" cellpadding="5">
  <tbody><tr class="body">
    <td width="143">Requirements</td>
    <td width="217">Design</td>
    <td width="152">Test</td>
  </tr>
  <tr class="body">
    <td><a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/blackboxtests.html#user_stories">User Stories</a><br>
        <a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/blackboxtests.html#use_cases">Use Cases</a> <br>
        <a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/pictures/cm_usecase.gif">Use Case Diagram</a> </td>
    <td><p><a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/pictures/cm_class.gif">Class Diagram</a><br>
            <a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/coffee_maker/pictures/cm_seq.gif">Sequence Diagram</a><br>
        State Chart Diagram<br>
    </p></td>
    <td>Acceptance Tests<br>
      FIT Solution<br>
      JUnit Solution </td>
  </tr>
</tbody></table>
<hr align="left" width="765">
<a href="http://agile.csc.ncsu.edu/SEMaterials/tutorials/index.html" class="body">Back to Software Engineering Tutorials</a>
<hr align="left" width="765">
<span class="body">CoffeeMaker Example for CSC 326 Tutorials ©2003-2005<a href="http://www.ncsu.edu/">North Carolina State University</a>, Laurie Williams, Dright Ho, Sarah Smith <br>
Email <a href="mailto:sesmith5@ncsu.edu?subject=CSC326%20Lab%20Tutorials%20-%20CoffeeMaker%20Example%20Tests">Sarah Smith</a> with any questions or comments about this example.<br>
Last Updated: <!-- #BeginDate format:fcAm1a -->Monday, August 25, 2008 12:34 PM<!-- #EndDate --></span>

</body></html>